package com.itheima.service;

import com.itheima.mapper.BookMapper;
import com.itheima.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * @Author CandyWall
 * @Date 2022/1/24--1:04
 * @Description
 */
@Service
public class BookServiceImpl implements IBookService {
    @Autowired
    BookMapper bookMapper;
    @Override
    public Book getById(Serializable id) {
        return bookMapper.getById(id);
    }

    @Override
    public boolean save(Book book) {
        return bookMapper.save(book)>0;
    }

    @Override
    public boolean saveBatch(List<Book> list) {
        return false;
    }

    @Override
    public List<Book> list() {
        return bookMapper.list();
    }
}
